﻿//using common;
//using Letter.Tcp;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Net;
//using System.Net.Security;
//using tcp_text_2;

//namespace tcp_server_test
//{
//    public class Program
//    {
//        private static IPEndPoint address = new IPEndPoint(IPAddress.Loopback, 20003);

//        public static async Task Main(string[] args)
//        {
//            var server = TcpFactory.Server<Data>("server");
//            server.ConfigureOptions(new TcpServerOptions());
//            server.ConfigureConnection(() => { return new ServerConnection(); });
//            if (SocketConfig.useSsl)
//            {
//                server.ConfigureSsl(new SslServerOptions(SocketConfig.cert, false, false), stream =>
//                {
//                    return new SslStream(stream, true, (sender, certificate, chain, sslPolicyErrors) => true);
//                });
//            }
//            server.Build();
//            await server.StartAsync(address);



//            while (true)
//            {
//                System.Threading.Thread.Sleep(1000);
//            }
//        }
//    }
//}